#ifndef CUBE_BODY_H_
#define CUBE_BODY_H_

class Effect;
class Mesh;

class Body : public Asset
{
DECLARE_RTTI( Body, Asset )
public :

	struct Skin
	{
		Effect*				effect;
		LPD3DXMATRIX		mat;
		LPD3DXMATERIAL		material;
		Mesh*				mesh;
	};

	~Body();

	static Body*			Create( const std::string& name );

	void					AddSkin( Skin* pSkin ){ _skins.push_back( pSkin ); }

	Effect*					GetCommonFx(){ return _commonFx; }
	LPD3DXMATERIAL			GetCommonMaterial(){ return _commonMaterial; }
	D3DXMATRIX&				GetObjectMatrix(){ return _matObject; }
	std::vector< Skin* >&	GetSkins(){ return _skins; }

	void					SetCommonEffect( Effect* effect ){ _commonFx = effect; }
	void					SetCommonMaterial( LPD3DXMATERIAL material ){ _commonMaterial = material; }

private :
	Body( const std::string& name );

	Effect*					_commonFx;
	LPD3DXMATERIAL			_commonMaterial;
	D3DXMATRIX				_matObject;

	std::vector< Skin* >	_skins;
};

#endif